package JAVA300.第九章容器;

import java.util.HashSet;
import java.util.Set;

/**
 * 测试hashSet,
 * set无顺序 不可重复
 * list有顺序，可重复
 */

public class TestHashSet {
    public static void main(String[] args) {

        Set<String> set1 = new HashSet<>();
        set1.add("aa");
        set1.add("bb");

        Set<String> set2 = new HashSet<>();
        set2.add("hqq");
        set2.add("qyh");

        set1.addAll(set2);
        System.out.println(set1);//[aa, bb, qyh, hqq]


    }
}
